package com.ys.mapper.sys;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface SysMapper {
	
	/*
	 * 禁用ID自增
	 */
	public Integer disableIDENTITY_INSERT(@Param("tableName") String tableName);
	
	/*
	 * 启用ID自增
	 */
	public Integer enableIDENTITY_INSERT(@Param("tableName") String tableName);
	
	public List<Map<String, Object>> listSysCol(@Param("tableName") String tableName);

	/*
	 * 更新菜单的排序序号
	 */
	public int updateTsMenuInfoOfMenuOrder(@Param("guid")String guid, @Param("menuOrder")Integer menuOrder);

	/*
	 * 更新字段的排序序号
	 */
    public int updateTsDictionaryForFieldOfFieldid(@Param("guid")String guid, @Param("fieldid")Integer fieldid);

	/*
	 * 更新导入字段的排序序号
	 */
	public int updateYsColOfImportSortNo(@Param("id")Long id, @Param("importSortNo")Integer importSortNo);

	/*
	 * 更新排序序号
	 */
	public int updateSortNoById(@Param("tableName")String tableName, @Param("id")Long id, @Param("sortNo")Integer sortNo);

	/*
	 * 更新菜单的排序序号
	 */
	public int updateYsMenuOfSortNo(@Param("id")Long id, @Param("sortNo")Integer sortNo);

	/*
	 * 更新模块的排序序号
	 */
	public int updateTsDictionaryForModuleOfModuleOrder(@Param("guid")String guid, @Param("moduleOrder")Integer moduleOrder);
	
	public Integer getNextFieldid(@Param("moduleTable")String moduleTable);
	
	public Integer getNextFieldFieldFrontOrder(@Param("moduleTable")String moduleTable);
	
	public Integer getNextSortNoOfCol(@Param("menuId")Long menuId);
	
	public Integer getNextSortNoOfMenu(@Param("pid")Long pid);
	
	public Integer getNextModuleOrder(@Param("menuGuid")String menuGuid);
	
	public Integer getNextButtonSortNo(@Param("menuId")Long menuId);
	
	public Integer getNextYsModalSelectorFieldOfSortNo(@Param("pid")Long pid);
	
	public Integer getNextYsDictSortNo(@Param("dictKey")String dictKey);

    public void deleteTrueTbBaseInfoByGuid(@Param("guid") String guid);
	
	/*
	 * 获取表TB_BaseInfo的下一个aid
	 */
	public Integer getNextAidOfTbBaseInfo();
	
	public void deleteTrueYsRoleButtonByButton(@Param("buttonId") Long buttonId);


	/*
	 * 更新用户信息变动表状态停用
	 */
	public int updateTsUserChangeExceptCurrentId(@Param("userId") String userId, @Param("id")Long id);


	/*
	 * 更新组织树左节点
	 */
	public int updateTsOrganizationInfoNodeLftAddTwo(@Param("nodeRgt")Integer nodeRgt);

	/*
	 * 更新组织树右节点
	 */
	public int updateTsOrganizationInfoNodeRgtAddTwo(@Param("nodeRgt")Integer nodeRgt);


	/*
	 * 更新运营机构树左节点
	 */
	public int updateTsOperateOrgNodeLftAddTwo(@Param("nodeRgt")Long nodeRgt);

	/*
	 * 更新运营机构树右节点
	 */
	public int updateTsOperateOrgNodeRgtAddTwo(@Param("nodeRgt")Long nodeRgt);
	
    /*
     * 删除用户-机构
     */
	public void deleteTrueYsUserOrg(@Param("userId") String userId, @Param("orgId") String orgId);
	
	public Integer getTypeOfRoleMenu(@Param("roleId") Long roleId, @Param("menuId") Long menuId);
	
	public void clearTsOrganizationInfoTreeNode();
	
	public String getNextOrgId(@Param("orgKind") String orgKind);
	
	public String getNextUkey(
			@Param("databaseTableName") String databaseTableName,
			@Param("databaseFieldCode") String databaseFieldCode);
	
	public Integer getEncryptUserLevel(@Param("userId") String userId);
	
	public List<Map<String, Object>> listData(@Param("tableName") String tableName, @Param("updateTimeMin") String updateTimeMin);
	
}